#ifndef RANKDIALOG_H
#define RANKDIALOG_H

#include <QDialog>
#include <QWidget>
#include <QString>
#include <QVector>
#include <QListWidgetItem>
#include "ui_rankdialog.h"
#include <QSize>

#include "record.h"

namespace Ui {
class RankDialog;
}

struct player
{
    //定义player的结构体
    int score=0;
    QString name="";
};

class RankDialog : public QDialog
{
    Q_OBJECT

public:
    Ui::RankDialog *ui;
    explicit RankDialog(QWidget *parent = 0);
    ~RankDialog();    

    void readRank();
    void saveRank();
    void addRecord(int score,QString name);

    QFont myFont;
    QFont myFont2;
    QWidget sf;

    //compare distance to create a new rank
    bool judgeRanks(int score);

    QIcon* ic=new QIcon(":/others/res/Rank_icon.png");
    QList<player> plas;

signals:
    //定义的发到Start界面的信号
    void signalShowStartwindow();

private slots:
    void on_OKButton_clicked(bool checked);

private:    
    void initRankdialog();

};



#endif // RANKDIALOG_H
